//
//  LS_mainpageSecond1CollectionViewcell.m
//  breadPro
//
//  Created by 刘文超 on 2019/7/10.
//  Copyright © 2019 刘文超. All rights reserved.
//

#import "LS_mainpageSecond1CollectionViewcell.h"
#import "LS_SoreItemModel.h"
@interface LS_mainpageSecond1CollectionViewcell()
@property(nonatomic,strong)UIImageView *lwc_logoImageView;
@property(nonatomic,strong)UILabel *lwc_leftLabel;
@end
@implementation LS_mainpageSecond1CollectionViewcell

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
    }return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat itemHeight = ScreenWidth/4-40;
    [self.lwc_logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(10);
        make.height.width.offset(itemHeight);
    }];
    
    
    [self.lwc_leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.equalTo(self.lwc_logoImageView.mas_bottom).offset(5);
        make.bottom.offset(-10);
    }];
    
    
}
-(void)setModel:(LS_SoreItemModel *)model
{
    _model = model;
    [self.lwc_logoImageView sd_setImageWithURL:[NSURL URLWithString:model.sc_logo] placeholderImage:LS_Getimage(@"商品主图加载页")];
    self.lwc_leftLabel.text = model.sc_name;
    
}
-(UIImageView *)lwc_logoImageView
{
    return LS_LAZY(_lwc_logoImageView, ({
        UIImageView *imageView = [[UIImageView alloc]init];
        [self addSubview:imageView];
        imageView;
    }));
}
-(UILabel *)lwc_leftLabel
{
    return LS_LAZY(_lwc_leftLabel, ({
        UILabel *leftLabel = [[UILabel alloc]init];
        leftLabel.font=[UIFont systemFontOfSize:14 ];
        leftLabel.text=@"产品名称：";
        leftLabel.textAlignment = NSTextAlignmentCenter;
        leftLabel.backgroundColor=[UIColor clearColor];
        leftLabel.numberOfLines=2;
        [self addSubview:leftLabel];
        leftLabel;
    }));
}
@end
